# -*- coding: utf-8 -*-
'''
@author: Hugo
@file: 爬唯品会数据.py
@time: 2021/8/7 20:15

'''
import asyncio
import time

from pyppeteer import launch

async def ff():
    browser = await launch(headless=False,args=['--disable-infobars','--window- size=1920,1080'])

    page =await browser.newPage()
    # 绕过淘宝登录滑块
    await page.evaluateOnNewDocument('() =>{ Object.defineProperties(navigator,''{ webdriver:{ get: () => false } })}')
    await page.setUserAgent(
        "Mozilla/5.0 (Windows NT 6.0) AppleWebKit/536.5 (KHTML, like Gecko) Chrome/19.0.1084.36 Safari/536.5")
    await page.goto("https://login.taobao.com/member/login.jhtml?spm=a21bo.21814703.201864-2.d1.5af911d9qavWqL&f=top&redirectURL=http%3A%2F%2Fwww.taobao.com%2F")
    time.sleep(8)
    await page.type('#fm-login-id','ie')
    await page.type('#fm-login-password','123456')
    await page.click('.fm-btn')
    time.sleep(10)
asyncio.get_event_loop().run_until_complete(ff())